<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>五角星评分.html</title>
    <script src="js/jquery-3.6.3.js"></script>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
            list-style: none;
            box-sizing: border-box;
            text-decoration: none;
        }

        .clearfix::after {
            content: "";
            display: block;
            height: 0;
            clear: both;
            visibility: hidden;
        }

        .list li {
            font-size: 25px;
            float: left;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="content">
    <ul class="list">
        <li>🤍</li>
        <li>🤍</li>
        <li>🤍</li>
        <li>🤍</li>
        <li>🤍</li>
    </ul>
</div>
</body>

<script>
    $(function () {
        let xin = '🤍'
        let xin_fill = '💖'
        $('.list>li').on('mouseenter', function () {
            $(this).text(xin_fill).prevAll().text(xin_fill)
        }).on('mouseleave', function () {
            $('.list>li').text(xin)
            $('.list>li[currentClick]').text(xin_fill)
            $('.list>li[currentClick]').prevAll().text(xin_fill)
        }).on('click', function () {
            $(this).attr("currentClick", 'current').siblings().removeAttr('currentClick')
        })
    })


</script>
</html>